cmake_minimum_required (VERSION 2.8.8)
project (bobs-services CXX)

option (BUILD_SHARED_LIBS "Build project's libraries as shared or dynamic" ON)
option (BUILD_TESTING "Build test executables" OFF)

option (Boost_USE_STATIC_LIBS "Use boost static libraries" OFF)
option (Boost_USE_MULTITHREADED "Use boost multithreaded libraries" ON)
set (Boost_USE_STATIC_RUNTIME    OFF)
find_package (Boost 1.49.0 REQUIRED COMPONENTS system filesystem locale)

if (Boost_FOUND)
  include_directories(${Boost_INCLUDE_DIRS})
  # Do not do autolinking, FindBoost has already set the correct libraries
  add_definitions (-DBOOST_ALL_NO_LIB)

  if (NOT Boost_USE_STATIC_LIBS)
    add_definitions (-DBOOST_ALL_DYN_LINK)
  endif (NOT Boost_USE_STATIC_LIBS)
  
else (Boost_FOUND)
  set (BOOST_ROOT CACHE PATH "Boost root directory")
endif (Boost_FOUND)  

include_directories ("${PROJECT_SOURCE_DIR}/include")

set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

add_subdirectory (src)

if (BUILD_TESTING)
  enable_testing ()
  add_subdirectory (test/cppunit)
endif (BUILD_TESTING)  
